﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace BF
{
    public class HashSetRI<T> : CollectRecycleItem<HashSet<T>, T>,
                                ISet<T>, 
                                IReadOnlyCollection<T>
    {
        public HashSetRI()
        {
            Value = new HashSet<T>();
        }

        public void ExceptWith(IEnumerable<T> other)
        {
            Value.ExceptWith(other);
        }

        public void IntersectWith(IEnumerable<T> other)
        {
            Value.IntersectWith(other);
        }

        public bool IsProperSubsetOf(IEnumerable<T> other)
        {
            return Value.IsProperSubsetOf(other);
        }

        public bool IsProperSupersetOf(IEnumerable<T> other)
        {
            return Value.IsProperSupersetOf(other);
        }

        public bool IsSubsetOf(IEnumerable<T> other)
        {
            return Value.IsSubsetOf(other);
        }

        public bool IsSupersetOf(IEnumerable<T> other)
        {
            return Value.IsSupersetOf(other);
        }

        public bool Overlaps(IEnumerable<T> other)
        {
            return Value.Overlaps(other);
        }

        public bool SetEquals(IEnumerable<T> other)
        {
            return Value.SetEquals(other);
        }

        public void SymmetricExceptWith(IEnumerable<T> other)
        {
            Value.SymmetricExceptWith(other);
        }

        public void UnionWith(IEnumerable<T> other)
        {
            Value.UnionWith(other);
        }

        public new bool Add(T item)
        {
            return Value.Add(item);
        }

        public void Add(IEnumerable<T> items)
        {
            foreach (T t in items)
            {
                this.Add(t);
            }
        }
    }
}